using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Collections;
using System.Diagnostics;
using System.Text.RegularExpressions;

namespace task_runner
{
	class Task
	{
		/// <summary>
		/// Дата начала
		/// </summary>
		public DateTime DateStart { get; set; }

		/// <summary>
		/// Дата выполнения
		/// </summary>
		public DateTime DateEnd { get; set; }

		/// <summary>
		/// Имя файла
		/// </summary>
		public string FileName { get; set; }
		/// <summary>
		/// Имя задачи
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// Выполняемая команда
		/// </summary>
		public List<TskCommand> Commands { get; set; }

		/// <summary>
		/// Конструктор
		/// </summary>
		public Task()
		{
			DateStart = DateTime.Today;
			//DateEnd = DateTime.Today;
			Name = DateStart.ToShortDateString() + DateStart.ToShortTimeString();
			Commands = new List<TskCommand>();
		}

		/// <summary>
		/// Выполнение всех команд
		/// </summary>
		public string RunCommandAll()
		{
			string ret = "";
			foreach (TskCommand taskCommand in Commands)
			{
				ret += taskCommand.RunCommand();
			}
			return ret;
		}
	}
}
